﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MvcEngine.Core.Helpers;
using System.Diagnostics;

namespace MvcEngine.Core.Configuration
{
    public class ConnectionString : IConnectionString
    {
        private readonly string _value;

        public ConnectionString(IConfigurationManager configuration, string name)
        {
            Guard.ThrowIfNull(configuration, "configuration");
            Guard.ThrowIfEmptyString(name, "name");

            _value = configuration.ConnectionStrings(name);
        }

        public string Value
        {
            [DebuggerStepThrough]
            get
            {
                return _value;
            }
        }
    }
}
